package com.itheima.oopadvanced.polymorphic;

/**
 * @author Anomaly
 * @date 2022/12/19 23:37
 */
public class Test {
    public static void main(String[] args) {
        Animal dog = new Dog();
        Dog dog1 = new Dog();
        Animal cat = new Cat();
        dog.run();
//        dog.run2();
        cat.run();
        dog1.run2();
        System.out.println("dog.name = " + dog.name);
        System.out.println("dog1.name = " + dog1.name);
        System.out.println("-----------------");
        go(dog);
        go(cat);
    }

    public static void go(Animal animal) {
        animal.run();
    }
}
